<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位</title>
    <style>
       #div1 {
            width: 200px;
            height: 200px;
            border: 2px solid red;
            position: relative;
            left: 100px;
            top: 50px;
       } 

       #div2 {
        width: 50px;
        height: 50px;
        border: 2px solid rgb(14, 27, 206);
        position: absolute;
        left: 50px;
        top: 20px;
       }

    </style>
</head>
<body>
    <div id="div1">
        <div id="div2"></div>
    </div>
</body>
</html>